package com.xiaoxi.templatemethodmode.service;

/**
 * @ClassName StringDisplay
 * @Description
 * @Author xiaoxi
 * @Date 2023/3/8 22:35
 * @Version 1.0
 */
public class StringDisplay extends AbstractDisplay {

    private String str;

    public StringDisplay(String str) {
        this.str = str;
    }

    @Override
    public void open() {
        System.out.println("|------------------------------|");
    }

    @Override
    public void print() {
        System.out.println("|*        " + str + "       *|");
    }

    @Override
    public void close() {
        System.out.println("|------------------------------|");
    }
}
